package com.heiye.auth.constant;

/**
 * @Author: heiye
 * @CreateTime: 2024/09/14 下午13:27
 * @Description: TODO
 * @Version: 1.0
 */
public class RedisKeyConstants {

    /**
     * 手机短信验证码 KEY 前缀
     */
    private static final String PHONE_VERIFICATION_CODE_KEY_PREFIX = "verification_code:phone:";

    /**
     * 邮件验证码 KEY 前缀
     */
    private static final String EMAIL_VERIFICATION_CODE_KEY_PREFIX = "verification_code:email:";


    /**
     * 构建手机短信验证码 KEY
     *
     * @param phone
     * @return
     */
    public static String buildPhoneVerificationCodeKey(String phone) {
        return PHONE_VERIFICATION_CODE_KEY_PREFIX + phone;
    }

    /**
     * 构建邮件验证码  KEY
     *
     * @param email
     * @return
     */
    public static String buildEmailVerificationCodeKey(String email) {
        return EMAIL_VERIFICATION_CODE_KEY_PREFIX + email;
    }
}
